class Solution:
    def checkZeroOnes(self, s: str) -> bool:
        size = len(s)
        max1, max0 = 0, 0
        now, num = "", 0
        for i in range(size):
            if now == "":
                now, num = s[i], 1
            else:
                if s[i] == now:
                    num += 1
                else:
                    now, num = s[i], 1
            if now == "1":
                max1 = max(max1, num)
            else:
                max0 = max(max0, num)
        return max1 > max0


if __name__ == "__main__":
    print(Solution().checkZeroOnes("1101"))  # True
    print(Solution().checkZeroOnes("111000"))  # False
    print(Solution().checkZeroOnes("110100010"))  # False
